﻿using Corina.Datamodel.Base;
using Corina.Datamodel.Interface;
using Corina.Enumerations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;

namespace Corina.Datamodel.Entities
{
    [XmlTypeAttribute(Namespace = "http://tempuri.org/")]
    public class DevicePhotoInfo : DatamodelEntity, IDevicePhoto
    {
        #region Fields
        private int _id;
        private int _kindId = 0;
        private string _name;
        private string _original;
        private string _thumbnail;
        private bool _isOpen = true;
        private bool _isCover = false;
        #endregion

        #region Properties
        public int Id
        {
            get { return _id; }
            set
            {
                _id = value;
                RaisePropertyChanged(() => Id);
            }
        }
        public int KindId
        {
            get { return _kindId; }
            set
            {
                _kindId = value;
                RaisePropertyChanged(() => KindId);
            }
        }
        public string Name
        {
            get { return _name; }
            set
            {
                _name = value;
                RaisePropertyChanged(() => Name);
            }
        }
        public string Original
        {
            get { return _original; }
            set
            {
                _original = value;
                RaisePropertyChanged(() => Original);
            }
        }
        public string Thumbnail
        {
            get { return _thumbnail; }
            set
            {
                _thumbnail = value;
                RaisePropertyChanged(() => Thumbnail);
            }
        }
        public bool IsOpen
        {
            get { return _isOpen; }
            set
            {
                _isOpen = value;
                RaisePropertyChanged(() => IsOpen);
            }
        }
        public bool IsCover
        {
            get { return _isCover; }
            set
            {
                _isCover = value;
                RaisePropertyChanged(() => IsCover);
            }
        }
        #endregion

        protected override IEnumerable<DatabaseColumn> InitColumns()
        {
            yield return new DatabaseColumn("Id", true);
            yield return new DatabaseColumn("KindId");
            yield return new DatabaseColumn("Name");
            yield return new DatabaseColumn("Original");
            yield return new DatabaseColumn("Thumbnail");
            yield return new DatabaseColumn("IsOpen");
            yield return new DatabaseColumn("IsCover");
        }
    }
}